 
package view;

import java.awt.Dimension;
 
public class Home extends javax.swing.JFrame {
 
    public Home() {
        initComponents();
        jTabbedPane1.setMaximumSize(new Dimension(Integer.MAX_VALUE,Integer.MAX_VALUE));
    }

 
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jToolBar1 = new javax.swing.JToolBar();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        btnDashboard = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        btnDispositivos = new javax.swing.JButton();
        btnTipoDispositivos = new javax.swing.JButton();
        btnUsuarios = new javax.swing.JButton();
        jDesktopPane1 = new javax.swing.JDesktopPane();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBackground(new java.awt.Color(153, 204, 255));

        jToolBar1.setRollover(true);

        jTabbedPane1.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT);

        jPanel1.setLayout(new javax.swing.OverlayLayout(jPanel1));

        btnDashboard.setIcon(new javax.swing.ImageIcon("D:\\ICONOS 2012\\coquette-part-9-icons-set\\48x48\\transfer.png")); // NOI18N
        btnDashboard.setText("Control de Mando");
        btnDashboard.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnDashboard.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnDashboard.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDashboardActionPerformed(evt);
            }
        });
        jPanel1.add(btnDashboard);

        jTabbedPane1.addTab("Principal", jPanel1);

        jPanel2.setLayout(new javax.swing.BoxLayout(jPanel2, javax.swing.BoxLayout.LINE_AXIS));

        btnDispositivos.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/network.png"))); // NOI18N
        btnDispositivos.setText("Dispositivos");
        btnDispositivos.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnDispositivos.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnDispositivos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDispositivosActionPerformed(evt);
            }
        });
        jPanel2.add(btnDispositivos);

        btnTipoDispositivos.setIcon(new javax.swing.ImageIcon("D:\\ICONOS 2012\\coquette-part-9-icons-set\\48x48\\not_available.png")); // NOI18N
        btnTipoDispositivos.setText("Tipos de Dispotivos");
        btnTipoDispositivos.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnTipoDispositivos.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnTipoDispositivos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnTipoDispositivosActionPerformed(evt);
            }
        });
        jPanel2.add(btnTipoDispositivos);

        btnUsuarios.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/users.png"))); // NOI18N
        btnUsuarios.setText("Usuarios");
        btnUsuarios.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnUsuarios.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnUsuarios.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnUsuariosActionPerformed(evt);
            }
        });
        jPanel2.add(btnUsuarios);

        jTabbedPane1.addTab("Mantenimientos", jPanel2);

        jToolBar1.add(jTabbedPane1);

        jDesktopPane1.setBackground(new java.awt.Color(153, 204, 255));

        javax.swing.GroupLayout jDesktopPane1Layout = new javax.swing.GroupLayout(jDesktopPane1);
        jDesktopPane1.setLayout(jDesktopPane1Layout);
        jDesktopPane1Layout.setHorizontalGroup(
            jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        jDesktopPane1Layout.setVerticalGroup(
            jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 374, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 663, Short.MAX_VALUE)
            .addComponent(jDesktopPane1)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jDesktopPane1))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnUsuariosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUsuariosActionPerformed
        try {
            Usuarios usuarios = new Usuarios();
            usuarios.setLocation(this.getWidth()/2 - usuarios.getWidth()/2 ,this.getHeight()/2 - usuarios.getHeight()/2 - 80);
            jDesktopPane1.add(usuarios);
            usuarios.setVisible(true);
        } catch (Exception e) {
        }
    }//GEN-LAST:event_btnUsuariosActionPerformed

    private void btnDispositivosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDispositivosActionPerformed
        try {
            Dispositivos form = new Dispositivos();
            form.setLocation(this.getWidth()/2 - form.getWidth()/2 ,this.getHeight()/2 - form.getHeight()/2 - 80);
            jDesktopPane1.add(form);
            form.setVisible(true);
        } catch (Exception e) {
        }
    }//GEN-LAST:event_btnDispositivosActionPerformed

    private void btnTipoDispositivosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTipoDispositivosActionPerformed
        try {
             DispositivosTipos form = new DispositivosTipos();
            form.setLocation(this.getWidth()/2 - form.getWidth()/2 ,this.getHeight()/2 - form.getHeight()/2 - 80);
            jDesktopPane1.add(form);
            form.setVisible(true);
        } catch (Exception e) {
        }
    }//GEN-LAST:event_btnTipoDispositivosActionPerformed

    private void btnDashboardActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDashboardActionPerformed
        try {
            Dashboard form = new Dashboard();
            form.setLocation(this.getWidth()/2 - form.getWidth()/2 ,this.getHeight()/2 - form.getHeight()/2 - 80);
            jDesktopPane1.add(form);
            form.setVisible(true);
        } catch (Exception e) {
        }
    }//GEN-LAST:event_btnDashboardActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Home().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnDashboard;
    private javax.swing.JButton btnDispositivos;
    private javax.swing.JButton btnTipoDispositivos;
    private javax.swing.JButton btnUsuarios;
    private javax.swing.JDesktopPane jDesktopPane1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JToolBar jToolBar1;
    // End of variables declaration//GEN-END:variables

}
